home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
PROBLEMS
/
BENCHMARK
/
BUBBLESORT
/
bubbletest
/
!readme
next >
Wrap
Text File
|
1992-09-03
|
9KB
|
363 lines
Bubbletest (written by Martin Wuerthner and MUFTI)
==================================================
Test speed of different programing languages/tools on the Acorn Archimedes
==========================================================================
Test method: Bubblesort-algorithm for a array of 1000 Integers
--------------------------------------------------------------
Introdution
===========
This programs are written, to find out, how fast are the different programing
languages/tools are.
The results may help people to decide, what language/tool they should use,
if they have a time-intensive problem.
To make the programs easy to produce and easy to understand, I decided to use
a very simple algorithm.
It should be one of the type: short code, long distant runner.
The test method is a bubblesort-algorithm for a array of 1000 Integers.
In the worst case, bubblesort needs n*n swap-operations.
This give here 1 000 000 Swap-operations which is enough for running the
fastest program (currently written in assembler) and not too much for the
slowest program (currently written in gawk).
Testing data and result works via redirection of standartoutput to a file.
Users of languages on the acorn archimedes, we can't program, or don't use
the compiler/assembler/interpreter are wellcome to program such a test for
the 1000 Integer Bubblesort.
If you want to join the results, here please use the same algorithm for the
integerfield:
a very simple pseudorandom algorithm:
pseudorandom=123456;
for (count=0;count<1000;count++)
{
pseudorandom=(pseudorandom + 234567) % 567 + 345
array[count]=pseudorandom;
}
/* this is C-syntax, % means the modulo -operation */
Print the unsorted array to the screen, each number seperated by a newline
execute (C-syntax) system("time")
call your bubblesort routine
execute (C-syntax) system("time")
Print the sorted array to the screen, each number seperated by a newline
thats all.
There is a "prove" -program, which tests, if your data and result is the same
as mine.
For faster tools there is a program named "time1", which support a
systemvariable time1 with centiseconds. For this you need the "prove2" -program.
The files are arranged in the following way:
1 Directory per Language (e.g. Basic, Assembler ...)
in a directory:
!run script to start execution of program
makeprog script to tokenize/compile/assemble the program (if needed)
maketime output of makeprog tells you who long is tokenize/compile/assemble time
program tokenized/compiled/assembled image of the program
source source of the program (in ascii)
time tells you how long your program took for the bubblesort
output file with program output
input extra input file, if you need some
timer extra obey file with *time-command, if you need some
!run
should include something like the following to test result and
generate "time" (for tool xxx):
*if "<xxx$path>"="" then error 1 xxx$path not set ! set xxx$path
set bubble_xxx$dir <obey$dir>
| if you need centiseconds
if "<time1>" = "" then run <bubbletest$dir>.Time1
<xxx$path>xxx <bubble_xxx$dir>.program { > <bubble_xxx$dir>.output }
set bubbletest$dir <obey$dir>.^
| if you need centiseconds
<bubbletest$dir>.prove2 <bubble_xxx$dir>.output [<number>] { > <bubble_xxx$dir>.time }
|else
<bubbletest$dir>.prove <bubble_xxx$dir>.output [<number>] { > <bubble_xxx$dir>.time }
settype <bubble_xxx$dir>.time text
<bubble_xxx$dir>.time
| <number> is optional and is only needed, if your tool outputs
| <number> lines before it starts the execution of your program
makeprog
should include something like the following to generate "maketime"
(for tool xxx):
set bubble_xxx$dir <obey$dir>
time { > <bubble_xxx$dir>.maketime }
compile/tokenize/assembler <bubble_xxx$dir>.source <bubble_xxx$dir>.program
time { >> <bubble_xxx$dir>.maketime }
settype <bubble_xxx$dir>.maketime text
<bubble_xxx$dir>.maketime
Here are the results on a ARM2 (tokenize/compile/assemble -time counts for
ramdisc)
==============================================================================
language:
ARM assembler (optimized)
tool:
TLA
needed software for execution:
-
time for execution:
~2.32 sec
needed software for assembling:
TLA0.1h (set tla$path)
clib - module
fpemulator - module
time for assembling
~3 sec
note: the macros in bubbletest.assembler.needed are freeware (not public
domain)
(only the messured bubblesort routine is exclusive optimized assembler)
==============================================================================
language:
ARM assembler
tool:
TLA
needed software for execution:
-
time for execution:
~2.60 sec
needed software for assembling:
TLA0.1h (set tla$path)
clib - module
fpemulator - module
time for assembling
~3 sec
note: the macros in bubbletest.assembler.needed are freeware (not public
domain)
(only the messured bubblesort routine is exclusive optimized assembler)
==============================================================================
language:
C (optimized)
tool:
ansi-C version 4
needed software for execution:
clib - module
time for execution:
~2.72 sec
needed software for compiling:
C compiler package
time for preprocessor/assembling
~5 sec
==============================================================================
language:
C
tool:
ansi-c version 4
needed software for execution:
clib - module
time for execution:
~3-4 sec
needed software for preprocessor/assembling:
C compiler package
time for preprocessor/assembling
~5 sec
==============================================================================
language:
- (optimized)
tool:
formula007 BETA
needed software for execution:
-
time for execution:
~4.65 sec
needed software for preprocessor/assembling:
iconx version 8.00 (set iconx$path)
!formula version 007 BETA
tla 0.1h (set tla$path)
time for preprocessor/assembling
~24 sec (wish to have iconc on the acorn archimedes 8-( ...)
==============================================================================
language:
-
tool:
formula version 0.69999
needed software for execution:
-
time for execution:
~10 sec
needed software for preprocessor/assembling:
gawk_l (set gawk$path/set gawk$prog)
!formula version 0.69999
tla 0.1h (set tla$path)
time for preprocessor/assembling
~34 sec
==============================================================================
language:
forth
tool:
aforth compiler/interpreter
needed software for execution:
aforth
time for execution:
~12-13 sec
==============================================================================
language:
forth
tool:
tile-forth compiler/interpreter (archimedes version 2.00)
needed software for execution:
tile-forth version 2.00
clib - module
fpemulator - module
time for execution:
~73 sec
=============================================================================
language:
basic
tool:
BBC BASIC V interpreter
needed software for execution:
basic - module
time for execution:
~349 sec
needed software for tokenizing:
basic -module
time for tokenizing:
~1 sec
=============================================================================
language:
icon
tool:
icon8 tokenizer/interpreter
needed software for execution:
iconx (set iconx$path)
clib - module
fpemulator - module
time for execution:
~820 sec ( ~937 sec without the '<->' swap operator )
needed software for tokenizing:
icont (set icont$path)
clib - module
fpemulator - module
time for tokenizing:
~2 sec
==============================================================================
language:
perl
tool:
perl interpreter
needed software for execution:
perl (set perl$path)
clib - module
fpemulator - module
time for execution:
~3188 sec
==============================================================================
language:
nawk
tool:
gawk_l interpreter
needed software for execution:
gawk_l (set gawk_l$path)
clib - module
fpemulator - module
time for execution:
~4939 sec
=============================================================================
language:
nawk
tool:
gawk interpreter
needed software for execution:
gawk (set gawk$path)
clib - module
fpemulator - module
time for execution:
~10502 sec
=============================================================================
****************************************************************************
All files here are public domain, accept bubbletest.assembler.needed, which
is a conclusion of !formula.tlastatrel and !formula.functions, which are
freeware
****************************************************************************